import config from "../config.js";
import { post, get, mihayoGet} from './request.js';
const {pongAPI, mihayoAPI} = config;
export function getEndId(uid) {
	return get(`${pongAPI}/console/genshin/gacha-log/${uid}/end-id`)
}

export function asyncApplet(data) {
	return post(`${pongAPI}/console/genshin/gacha-log/import/applet`, data)
	// return post('localhost:3000/data', data)
}
export function statistic(uid) {
	return get(`${pongAPI}/console/genshin/gacha-log/${uid}/statistic`)
}
export function querygachaType() {
	return get(`${pongAPI}/console/genshin/gacha-log/gacha-type`)
}

export function queryLog(gacha_type, authkey, endId = 0) {
  return mihayoGet(`${mihayoAPI}/event/gacha_info/api/getGachaLog?authkey_ver=1&init_type=${gacha_type}&lang=zh-cn&gacha_type=${gacha_type}&size=20&authkey=${authkey}&end_id=${endId}`)
}